package com.kuang.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
// 等价于<bean id="user" class="com.kuang.pojo.User"></bean>
public class User {
    public String name;

    @Value("小明")
    // 等价于 <property name="属性" value="值"></property>
    public void setName(String name) {
        this.name = name;
    }
}
